VxOptionMenu


Create an OptionMenu containing PushButtons for specified options

Syntax

VxOptionMenu object_name label optionList defaultCB selection

Description

Creates an OptionMenu containing PushButtons for the options specified.

Arguments

object_name
The widget hierarchy of the OptionMenu.

label
The Menu Label.

optionList
A list of strings to be used as Labels for the PushButtons.

defaultCB
The callback to be called when the OptionMenu changes.

selection
The option which is initially selected.

Example

The following code produces an OptionMenu.

set app [VtOpen demo]
set form [VtFormDialog $app.form -title "VxOptionMenu Demo" ]

set label "Choose your favorite fruit:"
set optionList {Kumquat Apple Orange}
set selected "Kumquat"
set callback defaultCB

VxOptionMenu $form.menuopt $label $optionList $callback $selected 

VtShow $form
VtMainLoop

This code produces the following: